home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / idl / nsIDictionary.idl < prev    next >
Text File  |  2006-05-08  |  4KB  |  103 lines

  1. /* ***** BEGIN LICENSE BLOCK *****
  2.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  3.  *
  4.  * The contents of this file are subject to the Mozilla Public License Version
  5.  * 1.1 (the "License"); you may not use this file except in compliance with
  6.  * the License. You may obtain a copy of the License at
  7.  * http://www.mozilla.org/MPL/
  8.  *
  9.  * Software distributed under the License is distributed on an "AS IS" basis,
  10.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  11.  * for the specific language governing rights and limitations under the
  12.  * License.
  13.  *
  14.  * The Original Code is Mozilla XPCOM Dictionary.
  15.  *
  16.  * The Initial Developer of the Original Code is
  17.  * Digital Creations 2, Inc.
  18.  * Portions created by the Initial Developer are Copyright (C) 2000
  19.  * the Initial Developer. All Rights Reserved.
  20.  *
  21.  * Contributor(s):
  22.  *   Martijn Pieters <mj@digicool.com> (original author)
  23.  *
  24.  * Alternatively, the contents of this file may be used under the terms of
  25.  * either the GNU General Public License Version 2 or later (the "GPL"), or
  26.  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27.  * in which case the provisions of the GPL or the LGPL are applicable instead
  28.  * of those above. If you wish to allow use of your version of this file only
  29.  * under the terms of either the GPL or the LGPL, and not to allow others to
  30.  * use your version of this file under the terms of the MPL, indicate your
  31.  * decision by deleting the provisions above and replace them with the notice
  32.  * and other provisions required by the GPL or the LGPL. If you do not delete
  33.  * the provisions above, a recipient may use your version of this file under
  34.  * the terms of any one of the MPL, the GPL or the LGPL.
  35.  *
  36.  * ***** END LICENSE BLOCK ***** */
  37.  
  38. /*
  39.  *  Simple dictionary implementation.
  40.  *  Version: $Revision: 1.2 $
  41.  *
  42.  *  $Id: nsIDictionary.idl,v 1.2 2004/04/18 22:14:12 gerv%gerv.net Exp $
  43.  */
  44.  
  45. #include "nsISupports.idl"
  46.  
  47. /**
  48.  * A simple mutable table of objects, accessed by key.
  49.  */
  50. [scriptable, uuid(1dd0cb45-aea3-4a52-8b29-01429a542863)]
  51. interface nsIDictionary: nsISupports {
  52.     /**
  53.      * Check if a given key is present in the dictionary.
  54.      *
  55.      * @param key       Key to check for
  56.      * @return          true if present, false if absent.
  57.      */
  58.     boolean hasKey(in string key);
  59.  
  60.     /**
  61.      * Retrieve all keys in the dictionary.
  62.      *
  63.      * @return          array of all keys, unsorted.
  64.      */
  65.     void getKeys(out PRUint32 count,
  66.         [retval, array, size_is(count)] out string keys);
  67.     
  68.     /**
  69.      * Find the value indicated by the key.
  70.      *
  71.      * @param key       The lookup key indicating the value.
  72.      * @return          Value indicated by key. If the key doesn't exist,
  73.      *                  NS_ERROR_FAILURE will be returned.
  74.      */
  75.     nsISupports getValue(in string key);
  76.  
  77.     /**
  78.      * Add the key-value pair to the dictionary.
  79.      * If the key is already present, replace the old value
  80.      * with the new.
  81.      *
  82.      * @param key       The key by which the value can be accessed
  83.      * @param value     The value to be stored.
  84.      */
  85.     void setValue(in string key, in nsISupports value);
  86.     
  87.     /**
  88.      * Delete the indicated key-value pair.
  89.      *
  90.      * @param key       The key indicating the pair to be removed.
  91.      * @return          The removed value. If the key doesn't exist,
  92.      *                  NS_ERROR_FAILURE will be returned.
  93.      */
  94.     nsISupports deleteValue(in string key);
  95.  
  96.     /**
  97.      * Delete all key-value pairs from the dictionary.
  98.      */
  99.     void clear();
  100. };
  101.  
  102. // vim:sw=4:sr:sta:et:sts:
  103.